module LocalusersHelper

  def get_roles_descritpion roles_mask
    roles = User::ROLES.reject { |r| ((roles_mask || 0) & 2**User::ROLES.index(r)).zero? }
    roles_str =""
    for role in User::ROLES
      if roles.include?(role)
        if roles_str.length > 0
          roles_str += ", " + t(role)
        else
          roles_str += t(role)
        end
      end
    end
    return roles_str
  end
  
end
